﻿
namespace Jim.SHR;

/// <summary>
/// 分页下载考勤档案
/// flag = "add": 表 示 新 增 的 数 据 ， 取 数 结 果 ： createTime >= transmitStartTime and attendFileState= = 1
/// flag="modify": 表 示 后 期 修 改 的 数 据 ， 取 数 结 果	createTime < transmitStartTime <= lastUpdateTime and attendFileState = 1
/// flag = "del": 表示要输出的数据， 取数结： transmitStartTime <= lastUpdateTime and attendFileState = 2
/// flag = "all" 或者 不传入 flag 的值：表示新增，修改，删除的批量数据， 取数结果：lastUpdateTime	>= transmitStartTime
/// </summary>  

[Sdk("getAttendanceFiles", "分页下载考勤档案")]
public class SHRGetAttendanceFilesRequest : ISdkRequest<SHRGetAttendanceFilesResponse>
{

    /// <summary>每页数据条数，系统默认值 100</summary>
    /// <value>int</value>
    public int Rows { get; set; } = 100;
    /// <summary>
    /// 当前页数，系统默认值 1
    /// </summary>
    /// <value>string</value>
    public int Page { get; set; } = 1;
    /// <summary>
    /// 排序字段，系统默认 attendanceNum，非必填
    /// </summary>
    /// <value>string</value>
    public string Order { get; set; }

    /// <summary>
    /// 升序或者降序，系统默认升序，非必填
    /// </summary>
    /// <value>string</value>
    public string Direct { get; set; }

    /// <summary>
    /// 取数参考时间，时间格式 yyyy-MM-dd  或者：yyyy-MM-dd HH:mm:ss，系统默认系统当前时间
    /// </summary>
    /// <value>string</value>
    public string TransmitStartTime { get; set; } = DateTime.UtcNow.ToString("yyyy-MM-dd HH:mm:ss");

    /// <summary>
    /// 取数规则， 系统默认的是修改，新增，删除的数据
    /// </summary>
    /// <value>string</value>
    public string Flag { get; set; } = "modify";

}


public class SHRGetAttendanceFilesResponse : SdkResponse<SHRGetAttendanceFiles> { }

public class SHRGetAttendanceFiles
{
    /// <summary>
    /// 满足条件的总数据条数
    /// </summary>
    /// <value>string</value>
    public string TotalRecords { get; set; }
    /// <summary>
    /// 返回请求的页数
    /// </summary>
    /// <value>string</value>
    public string RealPage { get; set; }
    /// <summary>
    /// 满足条件的总页数
    /// </summary>
    /// <value>string</value>
    public string TotalPage { get; set; }
    /// <summary>
    /// 实际返回的数据条数
    /// </summary>
    /// <value>string</value>
    public string RealRows { get; set; }
    /// <summary>
    /// 节点 ID
    /// </summary>
    /// <value>string</value>
    public List<SHRGetAttendanceFile> AttendanceFileList { get; set; }

}


public class SHRGetAttendanceFile
{

    /// <summary>
    /// 节点 ID
    /// </summary>
    /// <value>string</value>
    public string IsAttendance { get; set; }
    /// <summary>
    /// 节点 ID
    /// </summary>
    /// <value>string</value>
    [JsonProperty("proposer.id")]
    public string ProposerId { get; set; }
    /// <summary>
    /// 节点 ID
    /// </summary>
    /// <value>string</value>
    public string AttendanceNum { get; set; }
    /// <summary>
    /// 节点 ID
    /// </summary>
    /// <value>string</value>
    [JsonProperty("proposer.name")]
    public string ProposerName { get; set; }
    /// <summary>
    /// 节点 ID
    /// </summary>
    /// <value>string</value>
    public string Flag { get; set; }
    /// <summary>
    /// 节点 ID
    /// </summary>
    /// <value>string</value>
    [JsonProperty("adminOrgUnit.name")]
    public string AdminOrgUnitName { get; set; }
    /// <summary>
    /// 节点 ID
    /// </summary>
    /// <value>string</value>
    [JsonProperty("position.name")]
    public string PositionName { get; set; }
    /// <summary>
    /// 节点 ID
    /// </summary>
    /// <value>string</value>
    public string AttendFileState { get; set; }
    /// <summary>
    /// 节点 ID
    /// </summary>
    /// <value>string</value>
    //[DataMember(Name = "")]
    [JsonProperty("proposer.number")]
    public string ProposerNumber { get; set; }
    /// <summary>
    /// 节点 ID
    /// </summary>
    /// <value>string</value>
    [JsonProperty("adminOrgUnit.displayName")]
    public string AdminOrgUnitDisplayName { get; set; }
}


